﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FarseerPhysics.Dynamics;
using FarseerPhysics.Collision.Shapes;
using FarseerPhysics.Factories;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Storage;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

namespace chemicall
{
    class dynamicEntity : PhysicalEntity
    {
        public Vector2 direction = Vector2.Zero;
        protected Vector2 speed = Vector2.Zero;

        public void LoadContent(ContentManager contentManager, World world, String assetName, Vector2 position, Nullable<Rectangle> entitySize, Nullable<Rectangle> spriteSize, Sprite id)
        {
            base.LoadContent(contentManager,world, assetName, position,  entitySize, spriteSize, id);
            body.IsStatic = false;
            body.IsBullet = true;
        }

        public void Update(GameTime gameTime)
        {
            Vector2 pos = body.Position;
            Position = pos;
            base.Update(gameTime, speed, direction);
            body.SetTransform(new Vector2(Position.X, Position.Y), 0.0f);
        }
    }
}
